<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>"/>
    
    <title>厦大植物检索与交流系统</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="厦大,植物检索,"/>
	<meta http-equiv="description" content="厦大植物检索与交流系统"/>
	<link rel="stylesheet" type="text/css" href="css/common.css"/>
	<link rel="stylesheet" type="text/css" href="css/addtopic.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery.ui.all.css"/>
	<link rel="stylesheet" type="text/css" href="css/validationEngine.jquery.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.7.3.custom.css"/>
	<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.dropdown.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.validationEngine-zh_CN.js" charset="utf-8"></script>
  	<script type="text/javascript" language="javascript" src="js/jquery.validationEngine.js" charset="utf-8"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.core.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.widget.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.button.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.bgiframe-2.1.2.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.mouse.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.draggable.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.position.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.dialog.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.core.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.slide.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.explode.js"></script>
	<script type="text/javascript" src="js/xhrUtil.js"></script>
	<script type="text/javascript" language="javascript" src="forum/addtopic.js"></script>
 	<script>
  	jQuery(document).ready(function(){
  		// 绑定jquery的验证插件
  		jQuery("#addtopic").validationEngine({
  			ajaxFormValidation: false,
  			validationEventTriggers:"blur", 
  			onAjaxFormComplete: ajaxValidationCallback
  		});	
  	});
  	function ajaxValidationCallback(status, form, json, options){

  	}
  	$(function() {
		$( "input:button", "body" ).button();
		$( "#dialog" ).dialog({
			autoOpen: false,
			show: "slide",
			hide: "explode",
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
		});
	});
  	</script>
  </head>
  
  <body>
<div id="wrapper">
	<div id="logo">
		<h1><a href="index.html">厦大植物检索与交流平台</a></h1>
	</div>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<% 
			Integer userId = (Integer)request.getSession().getAttribute("userId");
			Integer role = (Integer)request.getSession().getAttribute("role");
		%>
		<div id="menu">
			<ul class="dropdown">
				<li><a href="index.html">首页</a>
				</li>
				<li><a>植物检索</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-showSubject.html">专题库查找</a></li>
   					   <li><a href="plantManager-kindList.html?move=0&page.currentPage=1&keOrShu=1">分等级检索</a></li>
        			   <li><a href="retrieval-toMultichannel.html">多通道检索</a></li>
					   <li><a href="plantManager-mapSearch.html">地图植物定位</a></li>
					</ul>
				</li>
   				<% if(userId != null && userId > 0 ){ %>
				<li><a>植物信息管理</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-toAddPlant.html">新增植物</a></li>
   					   <li><a href="plantManager-toAddSubject.html">新增专题</a></li>
   					    <% if( role != null && role == 3){ %>
   					   <li><a href="plant-listKindKe.html">分类管理</a></li>
   					   <%} %>
					</ul>
				</li>
   				<%} %>
				<li><a>个人植物库</a>
					<ul class="sub_menu">
   					   <% if(userId != null && userId > 0 ){ %>
        			   <li><a href="system-tomodifypwd.html">修改密码</a></li>
     				   <li><a href="user-showUserInfo.html">查看个人信息</a></li>
 				       <li><a href="user-toModifyUserInfo.html">修改个人信息</a></li>
 				       <% if(userId != null && userId > 0 && role != null && role == 3){ %>
 				       <li><a href="user-userlist.html">用户管理</a></li>
 				        <%} %>
 				       <li><a href="logout.html">退出</a></li>
 				       <%}else{ %>
     				   <li><a href="system-toLogin.html?isIntercepted=1">登录</a></li>
   					   <li><a href="system-registerinfo.html">注册</a></li>
 				        <%} %>
					</ul>
				</li>
				<li><a href="forum.html">论坛</a>
				</li>
			</ul>
		</div>
		<!-- end #menu -->
	</div>
		<!-- end #menu -->
	</div>
	<!-- end #header -->
	<div id="page">
		<div id="content">
			<div class="add">
				<s:if test="addOrEdit == 2">
					<form id="addtopic" action="forum-modifyTopic.html" method="post">
				</s:if>
				<s:else>
					<form id="addtopic" action="forum-addTopic.html" method="post">
				</s:else>
					话题名称：<input id="topicname" name="topicBean.topicName" value="${topicBean.topicName}" type="text" class="validate[required,maxSize[20]]"/>
					<br /><br /><div class="text">话题描述：</div>
					<textarea id="description" name="topicBean.note" class="validate[optional,maxSize[200]]">${topicBean.note}</textarea>
	   				<br/><br/>设定版主：
	   				<select id="users" onchange="selectCharge(this.value);">
	   					<option value="0">-----</option>
						<s:iterator id="user" value="userList">
							<option value="<s:property value="#user.userId"/>"><s:property value="#user.name"/></option>
						</s:iterator>
	   				</select>
	   				
	   				<div id="chargePerson">
	   					<s:iterator value="chargeUser" id="user" status="st">
	   						<div class="adduser" id="adduser-<s:property value='#st.index + 1'/>">
	   							<label class="username"><s:property value='#user.name'/></label>
	   							<input type="button" class="cancelbtn" value="取消版主" onclick="cancelUser(-<s:property value='#st.index + 1'/>);"/>
	   							<input type="hidden" value="<s:property value='#user.userId'/>" name="chargePerson"/>
	   						</div>
	   					</s:iterator>
	   				</div>
	   			<s:if test="addOrEdit == 2">
	   				<input type="hidden" id="idTopic" name="topicBean.idTopic" value="${topicBean.idTopic}"/>
	   				<p class="submit"><input type="button" onclick="checkname();" value="完成修改" /></p>
	   			</s:if>
	   			<s:else>
	   				<p class="submit"><input type="button" onclick="checkname();" value="增加" /></p>
	   			</s:else>
	   			
				</form>
			</div>
			<!-- end #add -->
		</div>
		<!-- end #content -->
		<div id="dialog" title="提示">
			<p>
				<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
		系统中已经存在该话题，请换个专题名
			</p>
		</div>
		<!-- end #dialog -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
	<div id="footer">
		<p>
		<a href="index.html">返回首页</a>|
            Copyright &copy; 2012 厦门大学软件学院</p>
	</div>
	<!-- end #footer -->
</div>
</body>
</html>
